<?php
include ("header.php");
?>
<form action="knowas.php" method="post" name="add">
Новость:<br />	<textarea type="text" name="know" maxlength="500" rows="15" cols="50"></textarea><br>
<input type=submit value="Добавить">
</form>
<?php

mysql_query ("CREATE TABLE IF NOT EXISTS `know_as` (
`id_know` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`know` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;") or die(mysql_error());

/*CREATE TABLE IF NOT EXISTS `news` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`news` VARCHAR( 65535 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;") or die(mysql_error()); */
if ($_POST[know]) {
echo 'Последний ввод:';
echo '<br />';
echo $_POST[know];
echo '<br />';
$know = mysql_real_escape_string($_POST['know']);
mysql_query ("INSERT INTO know_as VALUES (0  ,'$know')") or die(mysql_error());
}
else {echo "Не введено!.<br> Пожалуйста, введите<br><br>";};
/*mysql_query ("DELETE FROM news WHERE id=1") or die(mysql_error());*/
 include ("footer.php");
 ?>


